package list;

import java.io.*;
class ListNode{
	int val;
	ListNode next;
	public ListNode(int val) {
		this.val = val;
	}
}
public class removeRep {
	public static void removeRep(ListNode head) {
		ListNode cur = head;
		ListNode prev = null, next = null;
		while(cur != null) {
			//每次循环初始化prev,next
			prev = cur;
			next = cur.next;
			while(next!=null) {
				//1-1-1-2-2-3-3-4-5-5-6-8-1-1-2-2-null
				if(cur.val==next.val) {
					prev.next = next.next;//删除next指向的节点
				}
				else {
					//cur.val != next.val
					prev = next;//prev到达当前next的位置
				}
				next = next.next;
			}
			cur = cur.next;
		}
	}
	
	public static ListNode createList(int[] arr) {
		ListNode head = new ListNode(arr[0]);
		ListNode tail = head;
		for(int i=1;i<n;i++) {
			tail.next = new ListNode(arr[i]);
			tail = tail.next;
		}
		return head;
	}
	public static int MAX = 500;
	public static int[] arr = new int[MAX];
	public static int n;
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StreamTokenizer in = new StreamTokenizer(br);
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		while(in.nextToken()!=in.TT_EOF) {
			n = (int)in.nval;
			for(int i=0;i<n;i++) {
				in.nextToken();  // 读取每个数值
				arr[i] = (int)in.nval;
			}
			ListNode head = createList(arr);
			removeRep(head);
			for(ListNode cur = head; cur != null; cur = cur.next) {
				out.print(cur.val+" ");
			}
			out.println();  // 每组输出后换行
		}
		out.flush();
		out.close();
		br.close();
	}
}
